import {InjectedConnector} from '@web3-react/injected-connector'
import {WalletConnectConnector} from '@web3-react/walletconnect-connector'
import {WalletLinkConnector} from '@web3-react/walletlink-connector'

export type WalletInfo = {
  name: string
  icon: string
  connector: InjectedConnector | WalletConnectConnector | WalletLinkConnector
}

export const injectedMetaMaskProvider = new InjectedConnector({
  supportedChainIds: [1, 3, 4, 5, 42, 56, 97, 128, 137, 246, 80001, 56, 2000],
})

export const walletConnectProvider = new WalletConnectConnector({
  rpc: {1: 'https://mainnet.infura.io/v3/PROJECT_ID'},
  bridge: 'https://bridge.walletconnect.org',
  qrcode: true,
})
export const walletLinkProvider = new WalletLinkConnector({
  url: 'https://mainnet.infura.io/v3/PROJECT_ID',
  appName: 'My dApp',
  appLogoUrl: 'https://example.com/logo.png',
})

export const SUPPORTED_WALLETS: {[key: string]: WalletInfo} = {
  METAMASK: {
    name: 'MetaMask',
    icon: '',
    connector: injectedMetaMaskProvider,
  },
}
